<?php
// Russell MySQL database engine
// by David Kendal
// -----------------
// THIS IS A SEPERATE COMPONENT FROM RUSSELL
// IT IS LICENSED UNDER THE GPL v3

class MySQL implements DB {
  public $link;
  public $query;
  
  public function __construct($username, $password, $db, $server="localhost", $port=3306) {
    $this->link = mysql_connect($server.":".$port, $username, $password);
    mysql_select_db($db, $this->link);
  }
  
  public function query($query) {
    return $this->query = mysql_query($query, $this->link);
  }
  
  public function fetch_array() {
    return mysql_fetch_array($this->query);
  }
  
  public function fetch_assoc_array() {
    return mysql_fetch_assoc($this->query);
  }
  
  public function fetch_row() {
    return mysql_fetch_row($this->query);
  }
}
?>